package cn.z2huo.knowledge.concurrency.thinkinginjava.section_21_3.syncCodeBlock;

class PairManipulator implements Runnable {

    private final BasePairManager pairManager;

    public PairManipulator(BasePairManager pairManager) {
        this.pairManager = pairManager;
    }

    @Override
    public void run() {
        while (true) {
            pairManager.increment();
        }
    }

    public String toString() {
        return "Pair: " + pairManager.getPair() + " checkCounter = " + pairManager.checkCounter.get();
    }

}
